<!DOCTYPE html>
<html lang="zh" xmlns:th="http://www.thymeleaf.org" >
<head>
    <th:block th:include="include :: header('设置责任人')" />
</head>
<body class="white-bg">
    <div class="wrapper wrapper-content animated fadeInRight ibox-content">
        <form class="form-horizontal m" id="form-set-add" th:object="${baseAddress}">
            <input name="dzbm" th:field="*{dzbm}" type="hidden">
            <div class="form-group">
                <label class="col-sm-3 control-label">地址名称：</label>
                <div class="col-sm-8">
                    <input name="dzmc" th:field="*{dzmc}" class="form-control" type="text">
                </div>
            </div>
            <div class="form-group">
                <label class="col-sm-3 control-label">单位名称：</label>
                <div class="col-sm-8">
                    <input name="dwxx" th:field="*{dwxx}" class="form-control" type="text">
                </div>
            </div>
            <div class="form-group">
                <label class="col-sm-3 control-label">责任民警：</label>
                <div class="col-sm-8">
                    <input name="policeName" th:field="*{policeName}" class="form-control" onclick="selectUsers()" type="text" readonly required>
                    <input name="policeId" type="hidden">
                </div>
            </div>
            <div class="form-group">
                <label class="col-sm-3 control-label">网格员：</label>
                <div class="col-sm-8">
                    <input name="gridMemberName" th:field="*{gridMemberName}" class="form-control" onclick="selectGrid()" type="text" readonly required>
                    <input name="gridMemberId" type="hidden">
                </div>
            </div>
        </form>
    </div>
    <th:block th:include="include :: footer" />
    <script type="text/javascript">
        var prefix = ctx + "control/address";

        $("#form-set-add").validate({
            focusCleanup: true
        });

        function selectUsers(){
            $.modal.open("设置责任民警", $.common.setURL(prefix + "/user"));
        }

        function selectGrid(){
            $.modal.open("设置网格员", $.common.setURL(prefix + "/grid"));
        }


        function submitHandler() {
            if ($.validate.form()) {
                $.operate.save(prefix + "/addPolice", $('#form-set-add').serialize());
            }
        }


    </script>
</body>
</html>
